package com.smedi.ismedi.inmail.core.domain.service.impl;

import com.smedi.ismedi.inmail.core.application.command.AppVersionQuery;
import com.smedi.ismedi.inmail.core.domain.aggregatemodel.AppVersion;
import com.smedi.ismedi.inmail.core.domain.repository.AppVersionRepository;
import com.smedi.ismedi.inmail.core.domain.service.AppVersionDomainService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @className: AppVersionDomainServiceImpl
 * @Description: TODO
 * @version: v1.0.0
 * @author: wzx
 * @date: 2023/8/30 10:27
 */

@Slf4j
@Service
@AllArgsConstructor
public class AppVersionDomainServiceImpl implements AppVersionDomainService {

    private final AppVersionRepository appVersionRepository;

    @Override
    public Long create(AppVersion appVersion) {
        appVersion.init();
        return appVersionRepository.create(appVersion);
    }

    @Override
    public Long update(AppVersion appVersion) {
        return appVersionRepository.update(appVersion);
    }

    @Override
    public void remove(AppVersionQuery appVersionQuery) {
        appVersionRepository.remove(appVersionQuery);
    }
}